#include "motor.h"
#include "sys.h"


 void PWM_OUT(float speed){//0 1
	 if(speed>0){
        int pwm = speed*TIM3_PWM_MAX;
		TIM_SetCompare2(TIM3,pwm);
		TIM_SetCompare1(TIM3,0);
	 }else{
        int pwm = -speed*TIM3_PWM_MAX;
		TIM_SetCompare1(TIM3,pwm);
		TIM_SetCompare2(TIM3,0);
	 }
 }

